package req

type AirportSaveReq struct {
	Id           int64  `json:"id" description:"机场id"`
	Name         string `json:"name"  valid:"Required;" description:"机场名"`
	Province     string `json:"province"  valid:"Required;" description:"省份名"`
	ProvinceCode string `json:"provinceCode"  valid:"Required;" description:"省份Code"`
	TypeDictId   int    `json:"typeDictId"  valid:"Required;" description:"机场类型对应字典Id"`
	Status       int    `json:"status" description:"机场状态"`
}

// ExperienceReq 任务经历请求
type ExperienceReq struct {
	DictId int64 `json:"dictId" description:"字典id"`
	Count  int   `json:"count" description:"次数"`
}

// EngineFieldReq 发动机字段
type EngineFieldReq struct {
	Id                int64 `json:"id" description:"id"`
	EngineDuration    int   `json:"engineDuration" description:"发动机工作时长，单位：秒"`
	EngineWorkCount   int   `json:"engineWorkCount" description:"发动机的启动次数"`
	StageWorkCount    int   `json:"stageWorkCount" description:"发动机的阶段启动次数"`
	PushbackDoorCount int   `json:"pushbackDoorCount" description:"发动机的总反推门打开次数"`
}

type ApuFieldReq struct {
	Id        int64 `json:"id" description:"id"`
	Duration  int   `json:"duration" description:"Apu工作时长，单位：秒"`
	WorkCount int   `json:"workCount" description:"APU的启动次数"`
}

type ComponentSaveReq struct {
	Engine1Field *EngineFieldReq `json:"engine1Field" description:"发动机1参数"`
	Engine2Field *EngineFieldReq `json:"engine2Field" description:"发动机2参数"`
	Engine3Field *EngineFieldReq `json:"engine3Field" description:"发动机3参数"`
	Engine4Field *EngineFieldReq `json:"engine4Field" description:"发动机4参数"`
	ApuField     *ApuFieldReq    `json:"apuField" description:"Apu参数"`
}

type AircraftSaveReq struct {
	ComponentSaveReq
	Id             int64            `json:"id" description:"id"`
	Code           string           `json:"code"  valid:"Required;" description:"飞机编号"`
	DeptId         int64            `json:"deptId"  valid:"Required;" description:"所属部门"`
	TypeDictId     int64            `json:"typeDictId"  valid:"Required;" description:"飞机类型对应字典Id"`
	StateDictId    int64            `json:"stateDictId"  valid:"Required;" description:"飞机状态对应字典Id"`
	FactoryTime    int64            `json:"factoryTime"  valid:"Required;" description:"出厂时间"`
	FlightDuration int              `json:"flightDuration"  valid:"Required;" description:"飞行时间:秒"`
	TotalLife      float32          `json:"totalLife"  valid:"Required;" description:"总寿命:年"`
	TotalUpDown    int              `json:"totalUpDown"  valid:"Required;" description:"总起落次数:次"`
	Enabled        int              `json:"enabled"  valid:"Required;" description:"启用状态,0:无效；1:有效"`
	CombatReady    int              `json:"combatReady" description:"战备状态：1-战备中"`
	LocationId     int64            `json:"locationId"  description:"机位Id"`
	Experiences    []*ExperienceReq `json:"experiences" description:"经历列表"`
}

type FlightTaskSaveReq struct {
	ComponentSaveReq
	Id                int64  `json:"id" description:"id"`
	Code              string `json:"code" valid:"Required;" description:"任务编号" `
	PlanStart         int64  `json:"planStart" valid:"Required;" description:"计划开始时间" `
	PlanEnd           int64  `json:"planEnd"  valid:"Required;" description:"计划结束时间" `
	PlanDuration      int    `json:"planDuration" description:"计划时长:秒"`
	ActualDuration    int    `json:"actualDuration" description:"实际时长秒"`
	PlanUpDownCount   int    `json:"planUpDownCount" description:"计划起落次数" `
	ActualUpDownCount int    `json:"actualUpDownCount" description:"实际起落次数" `
	TaskSceneId       int64  `json:"taskSceneId" valid:"Required;" description:"任务场景字典Id" `
	TaskTypeId        int64  `json:"taskTypeId" valid:"Required;" description:"任务类型字典Id" `
	TargetAirportId   int64  `json:"targetAirportId" valid:"Required;" description:"目标机场Id" `
	AircraftId        int64  `json:"aircraftId" valid:"Required;" description:"飞机Id" `
	Status            int    `json:"status" description:"任务状态"`
	PilotName         string `json:"pilotName" description:"飞行员名字"`
}

type FlightTaskRecommendReq struct {
	TaskCode        string `json:"taskCode" valid:"Required;" description:"任务编号" `
	PlanStart       int64  `json:"planStart" valid:"Required;" description:"计划开始时间" `
	PlanEnd         int64  `json:"planEnd" valid:"Required;" description:"计划结束时间" `
	TaskSceneId     int64  `json:"taskSceneId" valid:"Required;" description:"任务场景字典Id" `
	TargetAirportId int64  `json:"targetAirportId" valid:"Required;" description:"目标机场Id" `
}

// FlightTaskStatusReq 状态更改
type FlightTaskStatusReq struct {
	ActualDuration    int `json:"actualDuration" description:"实际时长:秒"`
	ActualUpDownCount int `json:"actualUpDownCount" description:"实际起落次数" `
	Status            int `json:"status" valid:"Required;" description:"任务状态:0默认;1任务完成;10任务取消;11故障取消;12:故障失效"`
	ComponentSaveReq
}

// LifetimeCountDurationReq 有寿维护
type LifetimeCountDurationReq struct {
	WorkCount        int `json:"workCount" description:"工作次数"`
	IntervalCount    int `json:"intervalCount" description:"下次保养间隔次数"`
	WorkDuration     int `json:"workDuration" description:"工作时长:秒"`
	IntervalDuration int `json:"intervalDuration" description:"下次保养间隔时长:秒"`
}

// LifetimeRecordReq 有寿维护
type LifetimeRecordReq struct {
	Type          int   `json:"type" valid:"Required;" description:"维护任务类型：1-机体A检，2-发动机维护，3-起落架，4-APU，5-液压软管"`
	AdjustType    int   `json:"adjustType" description:"调整类型:1-任务累加;2-校正;3-其他"`
	AircraftId    int64 `json:"aircraftId" valid:"Required;" description:"飞机Id"`
	ComponentType int   `json:"componentType" valid:"Required;"  description:"飞机组件类型：1-发动机1，2-发动机2，3-发动机3，4-发动机4，5-机体，6-起落架，7-APU，8-液压软管1，9-液压软管2"`
	LifetimeCountDurationReq
}

type AircraftLocationSaveReq struct {
	Id     int64  `json:"id" description:"id"`
	Code   string `json:"code" description:"代码"`
	No     int    `json:"no"   description:"编号"`
	Type   int    `json:"type"  valid:"Required;" description:"机位类型:default:1-普通机位，2-修理厂"`
	Status int    `json:"status" description:"机位使用状态"`
}

type AircraftComponentSaveReq struct {
	Id                int64  `json:"id" description:"id"`
	Status            int    `json:"status" description:"状态"`
	Code              string `json:"code"  valid:"Required;" description:"组件编号" `
	Name              string `json:"name"  valid:"Required;" description:"组件名字" `
	Type              int    `json:"type"  valid:"Required;" description:"配件类型1-发动机1，2-发动机2，3-发动机3，4-发动机4，5-机体，6-起落架，7-APU，8-液压软管1，9-液压软管2" `
	AircraftId        int64  `json:"aircraftId" description:"飞机Id" `
	WorkCount         int    `json:"workCount" description:"工作次数" `
	IntervalCount     int    `json:"intervalCount" description:"下次保养次数间隔" `
	WorkDuration      int    `json:"workDuration" description:"工作时长，单位秒" `
	IntervalDuration  int    `json:"intervalDuration" description:"下次保养时间间隔，单位秒" `
	StageWorkCount    int    `json:"stageWorkCount" description:"阶段启动次数" `
	PushbackDoorCount int    `json:"pushbackDoorCount" description:"总反推门打开次数" `
	RepairCount       int    `json:"repairCount" description:"大修次数" `
	DeptId            int64  `json:"deptId" description:"所属部门" `
	StateDictId       int64  `json:"stateDictId" description:"组件状态id" `
	FactoryTime       int64  `json:"factoryTime" description:"出厂时间" `
	StartUseTime      int64  `json:"startUseTime" description:"开始使用时间" `
	AcceptanceTime    int64  `json:"acceptanceTime" description:"验收时间" `
	TakeoffDuration   int    `json:"takeoffDuration" description:"起飞状态工作时间:秒" `
	RatedDuration     int    `json:"ratedDuration" description:"额定状态工作时间:秒" `
}
